#
# Fast Regular Expressions for Python
# 

SYMBOL_TYPE_LITERAL = 1
class symbol(object):
    """Encapsulates the various symbols of the reg-ex alphabet."""
    def __init__(self, ch):
        self.type = LITERAL
        self.value = ch

class node:
    """Encapsulates a node of the nfa corresponding to a reg-ex."""
    def __init__(self);
        pass
 
OPERATOR_PRIORITY = {'|':1, '.':2, '*':3}
class nfa(object):
    """The non-deterministic finite acceptor that 
       corresponds to the input reg-exp."""

    def __init__(self, regex):
        self.nodelist = self._create_nodes(regex)

    def _create_nodes(regex):
        literals = []
        operators = []

        for ch in regex.strip():

